//
//  ZQTriangleView.m
//  Wsloan_40
//
//  Created by 陈樟权 on 17/3/20.
//  Copyright © 2017年 com.wsloam. All rights reserved.
//

#import "ZQTriangleView.h"

@implementation ZQTriangleView

- (id)init
{
    self = [super init];
    if (self)
    {
        self.backgroundColor = [UIColor clearColor];
    }
    return self;
}
- (void)drawRect:(CGRect)rect
{
    // Drawing code
    CGContextRef ctx = UIGraphicsGetCurrentContext();
    CGContextBeginPath(ctx);
    
    CGContextMoveToPoint   (ctx, CGRectGetMaxX(rect) / 2, 0);
    CGContextAddLineToPoint(ctx, 0, CGRectGetMaxY(rect));
    CGContextAddLineToPoint(ctx, CGRectGetMaxX(rect), CGRectGetMaxY(rect));
//    CGContextAddLineToPoint(ctx, CGRectGetMaxX(rect), 0);
    
    CGContextClosePath(ctx);
    [[UIColor blueColor] setFill];  //设置填充色
    [[UIColor clearColor] setStroke];//设置边框颜色
    CGContextFillPath(ctx);
}

@end
